/**
 */
package org.mro.grib.model.files.firstEdition.impl;

import org.eclipse.emf.ecore.EAttribute;
import org.eclipse.emf.ecore.EClass;
import org.eclipse.emf.ecore.EPackage;
import org.eclipse.emf.ecore.EReference;

import org.eclipse.emf.ecore.impl.EPackageImpl;

import org.mro.grib.model.files.firstEdition.FirstEditionFactory;
import org.mro.grib.model.files.firstEdition.FirstEditionPackage;
import org.mro.grib.model.files.firstEdition.GRIBFile;
import org.mro.grib.model.files.firstEdition.Message;

import org.mro.grib.model.files.firstEdition.grids.GridsPackage;

import org.mro.grib.model.files.firstEdition.grids.impl.GridsPackageImpl;

import org.mro.grib.model.files.firstEdition.sections.SectionsPackage;

import org.mro.grib.model.files.firstEdition.sections.impl.SectionsPackageImpl;

import org.mro.grib.model.files.secondEdition.SecondEditionPackage;

import org.mro.grib.model.files.secondEdition.dataRepresentations.DataRepresentationsPackage;
import org.mro.grib.model.files.secondEdition.dataRepresentations.impl.DataRepresentationsPackageImpl;
import org.mro.grib.model.files.secondEdition.impl.SecondEditionPackageImpl;
import org.mro.grib.model.files.secondEdition.products.ProductsPackage;
import org.mro.grib.model.files.secondEdition.products.impl.ProductsPackageImpl;
import org.mro.grib.model.files.secondEdition.products.meteorological.MeteorologicalPackage;
import org.mro.grib.model.files.secondEdition.products.meteorological.impl.MeteorologicalPackageImpl;

/**
 * <!-- begin-user-doc -->
 * An implementation of the model <b>Package</b>.
 * <!-- end-user-doc -->
 * @generated
 */
public class FirstEditionPackageImpl extends EPackageImpl implements FirstEditionPackage {
	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	private EClass messageEClass = null;

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	private EClass gribFileEClass = null;

	/**
	 * Creates an instance of the model <b>Package</b>, registered with
	 * {@link org.eclipse.emf.ecore.EPackage.Registry EPackage.Registry} by the package
	 * package URI value.
	 * <p>Note: the correct way to create the package is via the static
	 * factory method {@link #init init()}, which also performs
	 * initialization of the package, or returns the registered package,
	 * if one already exists.
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @see org.eclipse.emf.ecore.EPackage.Registry
	 * @see org.mro.grib.model.files.firstEdition.FirstEditionPackage#eNS_URI
	 * @see #init()
	 * @generated
	 */
	private FirstEditionPackageImpl() {
		super(eNS_URI, FirstEditionFactory.eINSTANCE);
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	private static boolean isInited = false;

	/**
	 * Creates, registers, and initializes the <b>Package</b> for this model, and for any others upon which it depends.
	 * 
	 * <p>This method is used to initialize {@link FirstEditionPackage#eINSTANCE} when that field is accessed.
	 * Clients should not invoke it directly. Instead, they should simply access that field to obtain the package.
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @see #eNS_URI
	 * @see #createPackageContents()
	 * @see #initializePackageContents()
	 * @generated
	 */
	public static FirstEditionPackage init() {
		if (isInited) return (FirstEditionPackage)EPackage.Registry.INSTANCE.getEPackage(FirstEditionPackage.eNS_URI);

		// Obtain or create and register package
		FirstEditionPackageImpl theFirstEditionPackage = (FirstEditionPackageImpl)(EPackage.Registry.INSTANCE.get(eNS_URI) instanceof FirstEditionPackageImpl ? EPackage.Registry.INSTANCE.get(eNS_URI) : new FirstEditionPackageImpl());

		isInited = true;

		// Obtain or create and register interdependencies
		GridsPackageImpl theGridsPackage = (GridsPackageImpl)(EPackage.Registry.INSTANCE.getEPackage(GridsPackage.eNS_URI) instanceof GridsPackageImpl ? EPackage.Registry.INSTANCE.getEPackage(GridsPackage.eNS_URI) : GridsPackage.eINSTANCE);
		SectionsPackageImpl theSectionsPackage = (SectionsPackageImpl)(EPackage.Registry.INSTANCE.getEPackage(SectionsPackage.eNS_URI) instanceof SectionsPackageImpl ? EPackage.Registry.INSTANCE.getEPackage(SectionsPackage.eNS_URI) : SectionsPackage.eINSTANCE);
		SecondEditionPackageImpl theSecondEditionPackage = (SecondEditionPackageImpl)(EPackage.Registry.INSTANCE.getEPackage(SecondEditionPackage.eNS_URI) instanceof SecondEditionPackageImpl ? EPackage.Registry.INSTANCE.getEPackage(SecondEditionPackage.eNS_URI) : SecondEditionPackage.eINSTANCE);
		org.mro.grib.model.files.secondEdition.grids.impl.GridsPackageImpl theGridsPackage_1 = (org.mro.grib.model.files.secondEdition.grids.impl.GridsPackageImpl)(EPackage.Registry.INSTANCE.getEPackage(org.mro.grib.model.files.secondEdition.grids.GridsPackage.eNS_URI) instanceof org.mro.grib.model.files.secondEdition.grids.impl.GridsPackageImpl ? EPackage.Registry.INSTANCE.getEPackage(org.mro.grib.model.files.secondEdition.grids.GridsPackage.eNS_URI) : org.mro.grib.model.files.secondEdition.grids.GridsPackage.eINSTANCE);
		org.mro.grib.model.files.secondEdition.sections.impl.SectionsPackageImpl theSectionsPackage_1 = (org.mro.grib.model.files.secondEdition.sections.impl.SectionsPackageImpl)(EPackage.Registry.INSTANCE.getEPackage(org.mro.grib.model.files.secondEdition.sections.SectionsPackage.eNS_URI) instanceof org.mro.grib.model.files.secondEdition.sections.impl.SectionsPackageImpl ? EPackage.Registry.INSTANCE.getEPackage(org.mro.grib.model.files.secondEdition.sections.SectionsPackage.eNS_URI) : org.mro.grib.model.files.secondEdition.sections.SectionsPackage.eINSTANCE);
		ProductsPackageImpl theProductsPackage = (ProductsPackageImpl)(EPackage.Registry.INSTANCE.getEPackage(ProductsPackage.eNS_URI) instanceof ProductsPackageImpl ? EPackage.Registry.INSTANCE.getEPackage(ProductsPackage.eNS_URI) : ProductsPackage.eINSTANCE);
		MeteorologicalPackageImpl theMeteorologicalPackage = (MeteorologicalPackageImpl)(EPackage.Registry.INSTANCE.getEPackage(MeteorologicalPackage.eNS_URI) instanceof MeteorologicalPackageImpl ? EPackage.Registry.INSTANCE.getEPackage(MeteorologicalPackage.eNS_URI) : MeteorologicalPackage.eINSTANCE);
		DataRepresentationsPackageImpl theDataRepresentationsPackage = (DataRepresentationsPackageImpl)(EPackage.Registry.INSTANCE.getEPackage(DataRepresentationsPackage.eNS_URI) instanceof DataRepresentationsPackageImpl ? EPackage.Registry.INSTANCE.getEPackage(DataRepresentationsPackage.eNS_URI) : DataRepresentationsPackage.eINSTANCE);

		// Create package meta-data objects
		theFirstEditionPackage.createPackageContents();
		theGridsPackage.createPackageContents();
		theSectionsPackage.createPackageContents();
		theSecondEditionPackage.createPackageContents();
		theGridsPackage_1.createPackageContents();
		theSectionsPackage_1.createPackageContents();
		theProductsPackage.createPackageContents();
		theMeteorologicalPackage.createPackageContents();
		theDataRepresentationsPackage.createPackageContents();

		// Initialize created meta-data
		theFirstEditionPackage.initializePackageContents();
		theGridsPackage.initializePackageContents();
		theSectionsPackage.initializePackageContents();
		theSecondEditionPackage.initializePackageContents();
		theGridsPackage_1.initializePackageContents();
		theSectionsPackage_1.initializePackageContents();
		theProductsPackage.initializePackageContents();
		theMeteorologicalPackage.initializePackageContents();
		theDataRepresentationsPackage.initializePackageContents();

		// Mark meta-data to indicate it can't be changed
		theFirstEditionPackage.freeze();

  
		// Update the registry and return the package
		EPackage.Registry.INSTANCE.put(FirstEditionPackage.eNS_URI, theFirstEditionPackage);
		return theFirstEditionPackage;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public EClass getMessage() {
		return messageEClass;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public EAttribute getMessage_StartOffset() {
		return (EAttribute)messageEClass.getEStructuralFeatures().get(0);
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public EAttribute getMessage_EndOffset() {
		return (EAttribute)messageEClass.getEStructuralFeatures().get(1);
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public EReference getMessage_IndicatorSection() {
		return (EReference)messageEClass.getEStructuralFeatures().get(2);
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public EReference getMessage_ProductDefinitionSection() {
		return (EReference)messageEClass.getEStructuralFeatures().get(3);
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public EReference getMessage_GridDefinitionSection() {
		return (EReference)messageEClass.getEStructuralFeatures().get(4);
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public EReference getMessage_BitMapSection() {
		return (EReference)messageEClass.getEStructuralFeatures().get(5);
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public EReference getMessage_BinaryDataSection() {
		return (EReference)messageEClass.getEStructuralFeatures().get(6);
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public EClass getGRIBFile() {
		return gribFileEClass;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public EAttribute getGRIBFile_GribFile() {
		return (EAttribute)gribFileEClass.getEStructuralFeatures().get(0);
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public EReference getGRIBFile_Message() {
		return (EReference)gribFileEClass.getEStructuralFeatures().get(1);
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public FirstEditionFactory getFirstEditionFactory() {
		return (FirstEditionFactory)getEFactoryInstance();
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	private boolean isCreated = false;

	/**
	 * Creates the meta-model objects for the package.  This method is
	 * guarded to have no affect on any invocation but its first.
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public void createPackageContents() {
		if (isCreated) return;
		isCreated = true;

		// Create classes and their features
		messageEClass = createEClass(MESSAGE);
		createEAttribute(messageEClass, MESSAGE__START_OFFSET);
		createEAttribute(messageEClass, MESSAGE__END_OFFSET);
		createEReference(messageEClass, MESSAGE__INDICATOR_SECTION);
		createEReference(messageEClass, MESSAGE__PRODUCT_DEFINITION_SECTION);
		createEReference(messageEClass, MESSAGE__GRID_DEFINITION_SECTION);
		createEReference(messageEClass, MESSAGE__BIT_MAP_SECTION);
		createEReference(messageEClass, MESSAGE__BINARY_DATA_SECTION);

		gribFileEClass = createEClass(GRIB_FILE);
		createEAttribute(gribFileEClass, GRIB_FILE__GRIB_FILE);
		createEReference(gribFileEClass, GRIB_FILE__MESSAGE);
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	private boolean isInitialized = false;

	/**
	 * Complete the initialization of the package and its meta-model.  This
	 * method is guarded to have no affect on any invocation but its first.
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public void initializePackageContents() {
		if (isInitialized) return;
		isInitialized = true;

		// Initialize package
		setName(eNAME);
		setNsPrefix(eNS_PREFIX);
		setNsURI(eNS_URI);

		// Obtain other dependent packages
		GridsPackage theGridsPackage = (GridsPackage)EPackage.Registry.INSTANCE.getEPackage(GridsPackage.eNS_URI);
		SectionsPackage theSectionsPackage = (SectionsPackage)EPackage.Registry.INSTANCE.getEPackage(SectionsPackage.eNS_URI);

		// Add subpackages
		getESubpackages().add(theGridsPackage);
		getESubpackages().add(theSectionsPackage);

		// Create type parameters

		// Set bounds for type parameters

		// Add supertypes to classes

		// Initialize classes and features; add operations and parameters
		initEClass(messageEClass, Message.class, "Message", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); //$NON-NLS-1$
		initEAttribute(getMessage_StartOffset(), ecorePackage.getELong(), "startOffset", null, 1, 1, Message.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); //$NON-NLS-1$
		initEAttribute(getMessage_EndOffset(), ecorePackage.getELong(), "endOffset", null, 1, 1, Message.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); //$NON-NLS-1$
		initEReference(getMessage_IndicatorSection(), theSectionsPackage.getIndicatorSection(), null, "indicatorSection", null, 1, 1, Message.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); //$NON-NLS-1$
		initEReference(getMessage_ProductDefinitionSection(), theSectionsPackage.getProductDefinitionSection(), null, "productDefinitionSection", null, 1, 1, Message.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); //$NON-NLS-1$
		initEReference(getMessage_GridDefinitionSection(), theSectionsPackage.getGridDefinitionSection(), null, "gridDefinitionSection", null, 0, 1, Message.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); //$NON-NLS-1$
		initEReference(getMessage_BitMapSection(), theSectionsPackage.getBitMapSection(), null, "bitMapSection", null, 0, 1, Message.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); //$NON-NLS-1$
		initEReference(getMessage_BinaryDataSection(), theSectionsPackage.getBinaryDataSection(), null, "binaryDataSection", null, 1, 1, Message.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); //$NON-NLS-1$

		initEClass(gribFileEClass, GRIBFile.class, "GRIBFile", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); //$NON-NLS-1$
		initEAttribute(getGRIBFile_GribFile(), ecorePackage.getEString(), "gribFile", null, 1, 1, GRIBFile.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); //$NON-NLS-1$
		initEReference(getGRIBFile_Message(), this.getMessage(), null, "message", null, 1, -1, GRIBFile.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); //$NON-NLS-1$

		// Create resource
		createResource(eNS_URI);
	}

} //FirstEditionPackageImpl
